<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page session="false"%>
<%@ page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>用户登录</title>
  <link href="<c:url value="/resources/messages/messages.css" />" rel="stylesheet" type="text/css" />
  <link href="<c:url value="/resources/css/style.css" />" rel="stylesheet" type="text/css" />
  
  <link href="<c:url value="/resources/easyui/themes/icon.css" />" rel="stylesheet" type="text/css" />
  <link href="<c:url value="/resources/easyui/themes/default/easyui.css" />" rel="stylesheet" type="text/css" />
  <script src="<c:url value="/resources/easyui/jquery-1.7.1.min.js" />"></script>
  <script src="<c:url value="/resources/easyui/jquery.easyui.min.js" />"></script>
  <script src="<c:url value="/resources/scripts/html5.js" />"></script>
  
</head>

<script>
var validateUrl = '<c:url value="/admin/login" />';
$(document).ready(function(){
	
	$('#loginForm').attr('action', validateUrl);

});

  function resetForm(){
	  document.getElementById('loginForm').reset();
	  var message = document.getElementById('message');
	  if(message){
		  message.style.display = 'none';
	  }
  }
</script>

<body style="height:100%;width:100%;overflow:hidden;border:none;visibility:visible;" >
<div class="easyui-window" style="width:500px;height:300px;background:#fafafa;overflow:hidden"
			title="登录系统" border="false" resizable="false" draggable="true" minimizable="false" maximizable="false">
		<div class="header" style="height:60px;">
			<div class="toptitle" style="margin-top: 20px;">后台管理系统</div>
		    <c:if test="${not empty message}">
                <div id="message" class="error">
                    ${message}
                </div>
            </c:if>
		</div>

		<div style="padding:30px 0;">
		
			<form:form method="post" id="loginForm" modelAttribute="loginForm" action="">
				<div style="padding-left:150px">
					<table cellpadding="0" cellspacing="3">
						<tr>
							<td style="width:20%">登录帐号</td>
							<td style="width:40%"><form:input path="name" style="width:150px"/></td>
							<td style="width:40%"><form:errors path="name" cssClass="error" /></td>
						</tr>
						<tr>
							<td>登录密码</td>
							<td><form:input path="password" type="password" style="width:150px"/></td>
							<td><form:errors path="password" cssClass="error" /></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td></td>
							<td></td>
						</tr>
						<tr>
						    <td colspan="3" style="padding-left:55px">
								<input type="button" onclick="javascript:document.getElementById('loginForm').submit();" value="登 录"/>
								<input type="button" onclick="javascript:resetForm()" value="重 置"/>
							</td>
						</tr>
					</table>
				</div>
				
			</form:form>
		</div>
		

	</div> 
</body>
</html>